package com.iweb.service;

import com.iweb.mapper.PlaceMapper;
import com.iweb.pojo.Place;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PlaceServiceImp implements PlaceService {
    @Autowired
    PlaceMapper placeMapper;

    @Override
    public boolean addPlace(Place place) {
        return placeMapper.insert (place) > 0;
    }

    @Override
    public List selectPlace() {
        return placeMapper.selectList (1);
    }

    @Override
    public Place queryMoney(int type) {
        return placeMapper.queryMoney (type);    }

    @Override
    public int updatePlace(Place place) {
        return placeMapper.update(place);
    }

    @Override
    public int selectReMNumByTypeName(int type) {
        return placeMapper.selectReMNumByTypeName (type);
    }

    @Override
    public Place select(int type) {
        return placeMapper.select (type);
    }

    @Override
    public boolean delete(int placeID) {
        return placeMapper.delete(placeID)>0;
    }

    @Override
    public List selectAll() {
        return placeMapper.selectAll();
    }

    @Override
    public void updatePlaceStatus(Place place) {
        placeMapper.updatePlaceStatus(place);
    }
}
